package designpattern.builder.guitar;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 刘牌
 * @Date: 2021/12/16/10:44
 * @Description:
 */
public class Guitar {
   //弦
   private String guitarString;
   //弦钮
   private String stringButton;
   //面板
   private String panel;
   //拾音器
   private String pickup;
   //尺寸
   private float size;
   //指板
   private String fingerboard;

   public static class GuitarBuilder{
      Guitar guitar = new Guitar();

      public GuitarBuilder guitarString(String guitarString){
         guitar.setGuitarString(guitarString);
         return this;
      }

      public GuitarBuilder stringButton(String stringButton){
         guitar.setStringButton(stringButton);
         return this;
      }

      public GuitarBuilder panel(String panel){
         guitar.setPanel(panel);
         return this;
      }

      public GuitarBuilder pickup(String pickup){
         guitar.setPickup(pickup);
         return this;
      }

      public GuitarBuilder size(float size){
         guitar.setSize(size);
         return this;
      }

      public GuitarBuilder fingerboard(String fingerboard){
         guitar.setFingerboard(fingerboard);
         return this;
      }

      public Guitar build(){
         return guitar;
      }
   }




   public String getGuitarString() {
      return guitarString;
   }

   public void setGuitarString(String guitarString) {
      this.guitarString = guitarString;
   }

   public String getStringButton() {
      return stringButton;
   }

   public void setStringButton(String stringButton) {
      this.stringButton = stringButton;
   }

   public String getPanel() {
      return panel;
   }

   public void setPanel(String panel) {
      this.panel = panel;
   }

   public String getPickup() {
      return pickup;
   }

   public void setPickup(String pickup) {
      this.pickup = pickup;
   }

   public float getSize() {
      return size;
   }

   public void setSize(float size) {
      this.size = size;
   }

   public String getFingerboard() {
      return fingerboard;
   }

   public void setFingerboard(String fingerboard) {
      this.fingerboard = fingerboard;
   }

   @Override
   public String toString() {
      return "Guitar{" +
              "guitarString='" + guitarString + '\'' +
              ", stringButton='" + stringButton + '\'' +
              ", panel='" + panel + '\'' +
              ", pickup='" + pickup + '\'' +
              ", size=" + size +
              ", fingerboard='" + fingerboard + '\'' +
              '}';
   }
}
